//
//  HLZegoLiveKit.h
//  YueYue
//
//  Created by hulu001 on 2024/3/12.
//

#import <Foundation/Foundation.h>
#import <ZegoExpressEngine/ZegoExpressEngine.h>
#import "HLLiveFemaleModel.h"

NS_ASSUME_NONNULL_BEGIN

@protocol HLZegoLiveManagerDelegate <NSObject>

@optional

/// 进入房间的回调
/// @param users 接受者
- (void)live_onUserEnter:(NSArray<ZegoUser *> *)users;

/// 离开房间的回调
/// @param users 接受者
- (void)live_onUserLeave:(NSArray<ZegoUser *> *)users;


/// 直播结束
- (void)live_onCallEnd;



- (void)live_onRecievedCustom:(NSString *)response user:(ZegoUser *)user;

@end


typedef void(^HLLiveCallKitTokenHandler)(uint64_t uid, void(^complete)(NSString *token, NSError *error));



@interface HLZegoLiveKit : NSObject


@property (nonatomic, copy, nullable) HLLiveCallKitTokenHandler tokenHandler;

@property (nonatomic, weak) id<HLZegoLiveManagerDelegate> delegate;

@property (nonatomic, strong) HLLiveFemaleModel *female;

@property (nonatomic, strong) ZegoUser *user; //当前用户

@property (nonatomic, strong) NSArray <ZegoUser*>*users; //当前房间用户

+ (instancetype)sharedInstance;

- (void)start;

/// 加入直播间
- (void)joinWithFemale:(HLLiveFemaleModel *)female localView:(UIView *)localView;



/// 离开直播间
- (void)leaveWithCallback:(HLCommonCallback)callback;



/// Sends a Custom Command to the specified users in the same room.
- (void)sendCustomSingleControl:(NSString *)command;

@end

NS_ASSUME_NONNULL_END
